# $Id$
# Maintainer: Eric Bélanger <eric@archlinux.org>

pkgname=perl-xml-parser
pkgver=2.44
pkgrel=6
pkgdesc="Expat-based XML parser module for perl"
arch=('i686' 'x86_64')
license=('GPL' 'PerlArtistic')
url="http://search.cpan.org/dist/XML-Parser/"
depends=('perl' 'expat')
options=('!emptydirs')
source=("http://search.cpan.org/CPAN/authors/id/T/TO/TODDR/XML-Parser-${pkgver}.tar.gz")
sha1sums=('0ab6b932713ec1f9927a1b1c619b6889a5c12849')

build() {
  cd XML-Parser-${pkgver}
  perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd XML-Parser-${pkgver}
  make test
}

package() {
  cd XML-Parser-${pkgver}
  make DESTDIR="${pkgdir}" install

# template start; name=perl-binary-module-dependency; version=1;
if [[ $(find "$pkgdir/usr/lib/perl5/" -name "*.so") ]]; then
	_perlver_min=$(perl -e '$v = $^V->{version}; print $v->[0].".".($v->[1]);')
	_perlver_max=$(perl -e '$v = $^V->{version}; print $v->[0].".".($v->[1]+1);')
	depends+=("perl>=$_perlver_min" "perl<$_perlver_max")
fi
# template end;
}
